package pages

import (
	"github.com/templui/templui/internal/ui/layouts"
	"github.com/templui/templui/internal/ui/modules"
	"github.com/templui/templui/internal/ui/showcase"
)

templ Badge() {
	@layouts.DocsLayout(
		"Badge",
		"Badge component is used to display a small amount of information in a visual style.",
		[]modules.TableOfContentsItem{
			{
				ID:   "installation",
				Text: "Installation",
			},
			{
				ID:   "examples",
				Text: "Examples",
				Children: []modules.TableOfContentsItem{
					{
						ID:   "primary",
						Text: "Primary",
					},
					{
						ID:   "secondary",
						Text: "Secondary",
					},
					{
						ID:   "outline",
						Text: "Outline",
					},
					{
						ID:   "destructive",
						Text: "Destructive",
					},
					{
						ID:   "with_icon",
						Text: "With Icon",
					},
				},
			},
			{
				ID:   "api",
				Text: "API Reference",
				Children: []modules.TableOfContentsItem{
					{
						ID:   "badge",
						Text: "Badge",
					},
				},
			},
		},
	) {
		@modules.PageWrapper(modules.PageWrapperProps{
			Name:        "Badge",
			Description: templ.Raw("Badge component is used to display a small amount of information in a visual style."),
			Tailwind:    true,
			Breadcrumbs: modules.Breadcrumbs{
				Items: []modules.BreadcrumbItem{
					{
						Text: "Docs",
						Path: "/docs",
					},
					{
						Text: "Components",
						Path: "/docs/components",
					},
					{
						Text: "Badge",
					},
				},
			},
		}) {
			@modules.ExampleWrapper(modules.ExampleWrapperProps{
				ShowcaseFile:    showcase.BadgeDefault(),
				PreviewCodeFile: "badge_default.templ",
			})
			@modules.ContainerWrapper(modules.ContainerWrapperProps{
				Title: "Installation",
				ID:    "installation",
			}) {
				@modules.ComponentUsage(modules.ComponentUsageProps{
					ComponentName: "badge",
				})
			}
			@modules.ContainerWrapper(modules.ContainerWrapperProps{
				Title: "Examples",
				ID:    "examples",
			}) {
				@modules.ExampleWrapper(modules.ExampleWrapperProps{
					SectionName:     "Primary",
					ShowcaseFile:    showcase.BadgeDefault(),
					PreviewCodeFile: "badge_default.templ",
					ID:              "primary",
				})
				@modules.ExampleWrapper(modules.ExampleWrapperProps{
					SectionName:     "Secondary",
					ShowcaseFile:    showcase.BadgeSecondary(),
					PreviewCodeFile: "badge_secondary.templ",
					ID:              "secondary",
				})
				@modules.ExampleWrapper(modules.ExampleWrapperProps{
					SectionName:     "Outline",
					ShowcaseFile:    showcase.BadgeOutline(),
					PreviewCodeFile: "badge_outline.templ",
					ID:              "outline",
				})
				@modules.ExampleWrapper(modules.ExampleWrapperProps{
					SectionName:     "Destructive",
					ShowcaseFile:    showcase.BadgeDestructive(),
					PreviewCodeFile: "badge_destructive.templ",
					ID:              "destructive",
				})
				@modules.ExampleWrapper(modules.ExampleWrapperProps{
					SectionName:     "With Icon",
					ShowcaseFile:    showcase.BadgeWithIcon(),
					PreviewCodeFile: "badge_with_icon.templ",
					ID:              "with_icon",
				})
			}
			@modules.ContainerWrapper(modules.ContainerWrapperProps{
				Title: "API Reference",
				ID:    "api",
			}) {
				@modules.APILegend()
				<div id="badge">
					@modules.APITable(modules.APITableProps{
						Title:       "Badge",
						Description: "Badge component for displaying small pieces of information.",
						Items: []modules.APITableItem{
							{
								Name:        "ID",
								Type:        "string",
								Default:     "",
								Description: "Unique identifier for the badge element.",
								Required:    false,
							},
							{
								Name:        "Class",
								Type:        "string",
								Default:     "",
								Description: "Additional CSS classes to apply to the badge.",
								Required:    false,
							},
							{
								Name:        "Attributes",
								Type:        "templ.Attributes",
								Default:     "",
								Description: "Additional HTML attributes to apply to the badge element.",
								Required:    false,
							},
							{
								Name:        "Variant",
								Type:        "Variant",
								Default:     "default",
								Description: "Visual style variant. Options: 'default', 'secondary', 'destructive', 'outline'.",
								Required:    false,
							},
						},
					})
				</div>
			}
		}
	}
}
